package common.model.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.math3.fraction.BigFraction;

import java.math.BigInteger;

/**
 * 分数<br/>
 * {@link BigFraction}没有无参构造方法，不能用于接受前端参数，故使用该类接受前端参数，然后调用{@link #toBigFraction}转换为{@link BigFraction}
 *
 * @author 米泽鹏
 * @since 2023-11-30 下午 6:40
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Fraction {

	private BigInteger numerator;

	private BigInteger denominator;

	public BigFraction toBigFraction() {
		return new BigFraction(numerator, denominator);
	}

}
